package com.example.designpattenexample.state;

//环境角色
public class Context {

    private State currentState;

    public void setCurrentState(State currentState) {
        this.currentState = currentState;
    }

    //行为委托
    public void handle(State state){
        this.setCurrentState(state);
        this.currentState.handle();
    }


}
